INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
IF(WIN32)
	INCLUDE_DIRECTORIES(${3RDPARTY_DIR}/include/gdal)
	LINK_DIRECTORIES(${3RDPARTY_DIR}/lib/grpc)
	LINK_DIRECTORIES(D:/vcpkg/vcpkg/installed/x64-windows/lib)
ELSE(WIN32)
	INCLUDE_DIRECTORIES(/usr/include/iodbc)
    INCLUDE_DIRECTORIES(/usr/local/netcdfcxx/include)
	INCLUDE_DIRECTORIES(/usr/local/netcdf4/include)
	LINK_DIRECTORIES(/usr/local/netcdfcxx/lib)	
	LINK_DIRECTORIES(/usr/local/netcdf4/lib)
ENDIF(WIN32)

IF(WIN32)
	
SET(TARGET_H
    CommandTool/ExtractISO.h
    CommandTool/VdbToBin.h
    CommandTool/ExtractGrib.h
    CommandTool/ASCToBin.h
    CommandTool/CSVToJson.h
    CommandTool/MK_Algorithm.h
    MyTestCommandTool.h
    csv2json.h
    Test.h
    testNpy.h
    sqlpp11orm.h
    asc2w3dm.h
    TestSql.h
    TestSqlite.h
    TestGDAL.h
    TestNetcdf.h
    TestHTTP.h
    testTiff.h
    FDBFile.h
    PackSqlite.h
    MapDownload.h
    ConvertGeojson.h
    MBTileReader.h
    VectorTile.h
    vector_tile21/vector_tile.pb.h
    testReadPBF.h
    testStreamline.h
    mapbox/feature.hpp
    mapbox/geometry.hpp
    mapbox/geometry_io.hpp
    mapbox/geojsonvt.hpp
    mapbox/geojsonvt/clip.hpp
    mapbox/geojsonvt/convert.hpp
    mapbox/geojsonvt/simplify.hpp
    mapbox/geojsonvt/tile.hpp
    mapbox/geojsonvt/types.hpp
    mapbox/geojsonvt/wrap.hpp
    mapbox/util.hpp
    mapbox/geojsonvt_io.hpp
    mapbox/geojson_impl.hpp
    mapbox/geojsonvt_ioImp.hpp
)

SET(TARGET_SRC
    MyTestCommandTool.cpp
	Test.cpp
	plugin.cpp
    FDBFile.cpp
    MBTileReader.cpp
    VectorTile.cpp
    vector_tile21/vector_tile.pb.cc
    mapbox/util.cpp
)

SET(TARGET_ADDED_LIBRARIES
    drogon
    trantor
    OCServer
    OCGIS
    OCVolume
    OCGrib
    OCNetCDF
    OCesium
    libprotobuf
    #openvdb
)

ELSE(WIN32)

SET(TARGET_H
    Test.h
    testNpy.h
    sqlpp11orm.h
    asc2w3dm.h
    TestSql.h
    TestSqlite.h
    TestGDAL.h
    TestNetcdf.h
    TestHTTP.h
    testTiff.h
    FDBFile.h
    PackSqlite.h
    MapDownload.h
    ConvertGeojson.h
    testStreamline.h
    mapbox/geojson_impl.hpp
    mapbox/geojsonvt_ioImp.hpp
    mapbox/feature.hpp
    mapbox/geometry.hpp
    mapbox/geometry_io.hpp
    mapbox/geojsonvt.hpp
    mapbox/geojsonvt/clip.hpp
    mapbox/geojsonvt/convert.hpp
    mapbox/geojsonvt/simplify.hpp
    mapbox/geojsonvt/tile.hpp
    mapbox/geojsonvt/types.hpp
    mapbox/geojsonvt/wrap.hpp
    mapbox/util.hpp
    mapbox/geojsonvt_io.hpp
)

SET(TARGET_SRC
	Test.cpp
	plugin.cpp
    FDBFile.cpp
    mapbox/util.cpp
)
SET(TARGET_ADDED_LIBRARIES
    drogon
    trantor
    OCServer
    OCGIS
    OCVolume
    OCGrib
    OCNetCDF
    OCesium
    #libprotobuf
)

ENDIF(WIN32)

ADD_DEFINITIONS(-DIMATH_HALF_NO_LOOKUP_TABLE)


SETUP_GROUP()


IF(WIN32)
    SET(TARGET_EXTERNAL_LIBRARIES 
        ws2_32
        sqlite3
	    gdal
        geos
        geos_c
    )
ENDIF(WIN32)

SETUP_PLUGIN(MyTest)
SETUP_PLUGIN_DEP(MyTest OCMain)
SETUP_PLUGIN_DEP(MyTest OCServer)
SETUP_PLUGIN_DEP(MyTest OCGIS)
SETUP_PLUGIN_DEP(MyTest OCVolume)
SETUP_PLUGIN_DEP(MyTest OCGrib)
SETUP_PLUGIN_DEP(MyTest OCNetCDF)
SETUP_PLUGIN_DEP(MyTest OCesium)
